package com.jili.rsp;

import com.jili.enums.CommonEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * ClassName: Result
 * Package com.jili.stream.pojo
 * Description:
 *
 * @Author: 廖继礼
 * @Create: 2024/2/11
 * @Version: v1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {

    private Integer code;

    private String message;

    private T data;

    public Result ok(T data) {
        return new Result(CommonEnum.SUCCESS.getCode(), CommonEnum.SUCCESS.getMessage(), data);
    }

}
